package com.sgb.link.utils;

import com.sgb.link.api.LogisticsNet;
import com.sgb.link.entity.LogisticsFlowLog;
import com.swgk.core.base.api.ICallBack;
import com.swgk.core.base.model.entity.BaseEntity;

/**
 * @author: 王彬臣
 * @date: 2022/1/4
 * @Description: 物流埋点工具
 */
public class LogisticsLogUtils {
    public static volatile LogisticsLogUtils logisticsUtils;

    public static LogisticsLogUtils getInstance() {
        if (logisticsUtils == null) {
            synchronized (LogisticsLogUtils.class) {
                if (logisticsUtils == null) {
                    logisticsUtils = new LogisticsLogUtils();
                }
            }
        }
        return logisticsUtils;

    }

    public void logisticsFlow(String pageName, String element_name, String element_type) {
        LogisticsFlowLog log = new LogisticsFlowLog(pageName, element_name, element_type);
        LogisticsNet.getInstance().getService().buriedPoint(log).enqueue(new ICallBack<BaseEntity>() {
            @Override
            public void onSuccess(BaseEntity data) {

            }
        });
    }
    public void logisticsFlow(LogisticsFlowLog log) {
        LogisticsNet.getInstance().getService().buriedPoint(log).enqueue(new ICallBack<BaseEntity>() {
            @Override
            public void onSuccess(BaseEntity data) {

            }
        });
    }
}
